import { lazy } from "react";
import { Navigate } from "react-router-dom";
let Home=lazy(()=>import('../page/home/Index'))
let Index=lazy(()=>import('../page/index/Index'))
let Order=lazy(()=>import('../page/order/Index'))
let Message=lazy(()=>import('../page/message/Index'))
let My=lazy(()=>import('../page/my/Index'))
let List=lazy(()=>import('../page/list/Index'))
let Login=lazy(()=>import('../page/login/Index'))
import {
    AppOutline,
    MessageFill,
    UnorderedListOutline,
    UserOutline,
  } from 'antd-mobile-icons'
export const houserouters=[
    {
        path:'/home',
        element:<Home></Home>,
        title:'首页',
        icon:<AppOutline></AppOutline>
    },
    {
        path:'/order',
        element:<Order></Order>,
        title:'订单',
        icon:<UnorderedListOutline></UnorderedListOutline>
    },
    {
        path:'/message',
        element:<Message></Message>,
        title:'消息',
        icon:<MessageFill></MessageFill>
    },
    {
        path:'/my',
        element:<My></My>,
        title:'我的',
        icon:<UserOutline></UserOutline>
    },
]
export const  routes=[
    {
        path:'/',
        element:<Index></Index>,
        children:[
            ...houserouters,
            {
                path:'/',
                element:<Navigate to='/home'></Navigate>
            }
        ]
    },
    {
        path:'/list/:type',
        element:<List></List>
    },
    {
        path:'/login',
        element:<Login></Login>
    },
]
export default routes